package com.vichat.user.service;

import com.vichat.common.vo.PageFilter;
import com.vichat.user.entity.SecFunction;
import com.vichat.user.entity.SecRole;
import com.vichat.user.entity.SecRoleFunction;
import com.vichat.user.vo.MenuVO;
import com.vichat.user.vo.PrivilegeVO;
import com.vichat.user.vo.RoleMenuVO;
import com.vichat.user.vo.SecRoleFuncVO;

import java.util.HashMap;
import java.util.List;

/**
 * Created by user on 2017/11/15.
 */
public interface ISecService {

    /**
     * 返回角色信息（无参数）
     *
     * @return
     */
    public List<SecRole> querySecRole();

    /**
     * 根据条件查询角色信息
     *
     * @param queryBean
     * @return
     */
    public List<SecRole> querySecRole(SecRole queryBean, PageFilter pf);

    /**
     * 查询角色数量
     *
     * @param queryBean
     * @return
     */
    public Long countSecRole(SecRole queryBean) throws Exception;

    /**
     * 添加或者修改角色
     *
     * @param secRole
     * @throws Exception
     */
    public void saveOrUpdSecRole(SecRole secRole) throws Exception;

    /**
     * 根据角色编号获取角色信息
     *
     * @param roid
     */
    public SecRole querySecRoleByRoid(Long roid) throws Exception;

    /**
     * 根据角色编号删除角色
     *
     * @param roid
     */
    public void delSecRole(Long roid);


    /**
     * 返回菜单信息
     * 无参数
     *
     * @return
     */
    public List<SecFunction> querySecFunction();

    /**
     * 根据条件查询菜单信息
     *
     * @param queryBean
     * @return
     */
    public List<SecFunction> querySecFunction(SecFunction queryBean, PageFilter pf);

    /**
     * 查询菜单数量
     *
     * @param queryBean
     * @return
     */
    public Long countSecFunction(SecFunction queryBean) throws Exception;

    /**
     * 根据菜单编号获取菜单信息
     *
     * @param fid
     */
    public SecFunction querySecFuncByFid(Long fid) throws Exception;

    /**
     * 添加或者修改菜单
     *
     * @param secFunc
     * @throws Exception
     */
    public void saveOrUpdSecFunc(SecFunction secFunc) throws Exception;

    /**
     * 根据菜单编号删除菜单
     *
     * @param fid
     */
    public void delSecFunc(Long fid);

    /**
     * 根据一级菜单编号查询其是否有二级菜单
     *
     * @param fid
     */
    public Boolean IsFirstFunc(Long fid) throws Exception;

    /**
     * 根据角色编号查询菜单分配信息
     *
     * @param roid
     * @return
     */
    public List<SecFunction> querySecRoleFuncVOByRoid(Long roid);

    /**
     * @param
     * @return
     * @throws
     * @Title: queryAllMenuTree
     * @Description: 菜单树
     */
    public List<MenuVO> queryAllMenuTree(Long roleId);

    /**
     * @param
     * @return
     * @throws
     * @Title: saveSecRoleFunction
     * @Description: 角色分配菜单
     */
    public void saveSecRoleFunction(RoleMenuVO roleMenuVO);

    /**
     * 添加或者修改菜单
     *
     * @param secRoleFuncVos
     * @throws Exception
     */
    public void saveOrUpSecRoleFunction(List<SecRoleFuncVO> secRoleFuncVos) throws Exception;

    /**
     * 根据菜单编号获取菜单信息
     *
     * @param roid
     */
    public List<SecRoleFunction> querySecRoleFunctionByRoid(Long roid);

    /**
     * 根据角色编号查询菜单
     *
     * @param uid
     * @return
     */
    public List<PrivilegeVO> querySecPrivilege(long uid, long state);

    /**
     * @param @param  queryBean
     * @param @return
     * @return boolean
     * @throws
     * @Title: repeatSecRole
     * @Description: 判断角色菜单是否重复
     */
    public boolean repeatSecRole(SecRole queryBean);

    String checkBeforeSaveOrUpdate(SecFunction secFunc);


    /**
     * @param
     * @return
     * @throws
     * @Title: queryByRoidAndLevel
     * @Description: 根据角色查询按钮操作级别菜单
     */
    public List<String> queryByRoidAndLevel(Long roleId);

    /**
     * @param
     * @return
     * @throws
     * @Title: getMenus
     * @Description: 根据权限获取菜单
     */
    public List<SecFunction> getMenus(Long funcLevel, Long parentFid);

    public List<SecFunction> getUserEnableFunction(Long uid);

    /**
     * 根据用户编号查询菜单分配信息
     *
     * @param uid
     * @return
     */
    public List<SecFunction> querySecRoleFuncVOByUid(long uid);
    /**
     * 根据用户编号获取菜单分配信息(APP)
     *
     * @param uid
     * @return
     */
    public List<SecFunction> querySecRoleFuncVOByUidToApp(long uid);
}
